package com.magpiebridge.service.Impl;

import com.magpiebridge.dao.UsermsgDao;

import com.magpiebridge.pojo.Usermsg;
import com.magpiebridge.service.UsermsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsermsgServiceImpl implements UsermsgService {
    @Autowired
    private UsermsgDao usermsgDao;


    @Override
    public List<Usermsg> getAllUsermsg() {
        return usermsgDao.selectList(null);
    }

    @Override
    public Usermsg getUsermsgById(Integer id) {
        return usermsgDao.selectById(id);
    }

    @Override
    public int insertUsermsg(Usermsg usermsg) {
        return usermsgDao.insert(usermsg);
    }

    @Override
    public int updateUsermsg(Usermsg usermsg) {
        return usermsgDao.updateById(usermsg);
    }

    @Override
    public int deleteUsermsg(Integer id) {
        return usermsgDao.deleteById(id);
    }
}
